<extend name="Public/base"/>

<block name="style">
    <link rel="stylesheet" href="__STATIC__/plugins/data-tables/DT_bootstrap.css" />
</block>

<block name="body">


    <!-- 数据表格 -->
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN EXAMPLE TABLE PORTLET-->
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption">
                        <i class="fa fa-globe"></i>
                        [{$model['title']}] 列表
                    </div>
                    <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="table-toolbar">
                        <div class="btn-group">
                            <a class="btn green" href="{:U('add?model='.$model['id'])}">新 增</a>
                            <button class="btn green ajax-post confirm" target-form="ids" url="{:U('del?model='.$model['id'])}">删 除</button>  
                        </div>
                    </div>

                    <table class="table table-striped table-bordered table-hover" id="sample">
                        <thead>
                            <tr>
                                <th class="table-checkbox"><input type="checkbox" class="group-checkable" data-set="#sample .checkboxes" /></th>
                                
                                <volist name="list_grids" id="field">
                                <th>{$field.title}</th>
                                </volist>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="list_data" id="data">
                            <tr class="odd gradeX">
                                
                                <td><input class="checkboxes ids" type="checkbox" value="{$data['id']}" name="ids[]"/></td>
                                <volist name="list_grids" id="grid">
                                    <td>{:get_list_field($data,$grid,$model_list)}</td>
                                </volist>
                            </tr>
                            </volist>
                        </tbody>
                    </table>
                    
                    <!-- 分页 -->
                    <div class="page">
                        {$_page|default=''}
                    </div>
                    
                </div>
            </div>
            <!-- END EXAMPLE TABLE PORTLET-->
        </div>
    </div>




</block>

<block name="script">

    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <script type="text/javascript" src="__STATIC__/plugins/data-tables/jquery.dataTables.js"></script>
    <script type="text/javascript" src="__STATIC__/plugins/data-tables/DT_bootstrap.js"></script>
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="__STATIC__/scripts/app.js"></script>
    <script src="__STATIC__/scripts/table-managed.js"></script>    
    <script src="__STATIC__/scripts/form-components.js"></script> 
    <script type="text/javascript">
        jQuery(document).ready(function() {       
            App.init();
            TableManaged.init();

            highlight_subnav('{:U('Model/index')}');
        
        });
    </script>
</block>
